home *** CD-ROM | disk | FTP | other *** search
/ Artbeats: WebTools / Artbeats WebTools.iso / pc / extras / ibc2demo / intro.dir / 00999.ls < prev    next >
Encoding:
Text File  |  1996-02-28  |  8.2 KB  |  300 lines

  1. on morph total, delay, downSound, upSound
  2.   if stringp(downSound) then
  3.     puppetSound(downSound)
  4.   end if
  5.   set this to the castNum of sprite the clickOn
  6.   set wait to the timer
  7.   repeat with variable = 1 to total - 1
  8.     repeat while wait > the timer
  9.     end repeat
  10.     set the castNum of sprite the clickOn to this + variable
  11.     updateStage()
  12.     set wait to the timer + delay
  13.   end repeat
  14.   repeat while the stillDown or soundBusy(1)
  15.   end repeat
  16.   if stringp(upSound) then
  17.     puppetSound(upSound)
  18.   end if
  19.   set this to the castNum of sprite the clickOn
  20.   set wait to the timer
  21.   repeat with variable = 1 to total - 1
  22.     repeat while wait > the timer
  23.     end repeat
  24.     set the castNum of sprite the clickOn to this - variable
  25.     updateStage()
  26.     set wait to the timer + delay
  27.   end repeat
  28.   repeat while soundBusy(1)
  29.   end repeat
  30.   puppetSound(0)
  31. end
  32.  
  33. on click downSound, upSound
  34.   if stringp(downSound) then
  35.     puppetSound(downSound)
  36.   end if
  37.   set variable to the castNum of sprite the clickOn
  38.   set the castNum of sprite the clickOn to variable + 1
  39.   updateStage()
  40.   repeat while the stillDown or soundBusy(1)
  41.   end repeat
  42.   if stringp(upSound) then
  43.     puppetSound(upSound)
  44.   end if
  45.   set the castNum of sprite the clickOn to variable
  46.   updateStage()
  47.   repeat while soundBusy(1)
  48.   end repeat
  49.   puppetSound(0)
  50.   updateStage()
  51. end
  52.  
  53. on jogger total, downSound
  54.   if stringp(downSound) then
  55.     puppetSound(downSound)
  56.   end if
  57.   set myNumber to the castNum of sprite the clickOn
  58.   repeat while the stillDown
  59.     set vert to the mouseV - the locV of sprite the clickOn
  60.     set horz to the mouseH - the locH of sprite the clickOn
  61.     if horz < 0 then
  62.       set angle to 3.14159260000000007 * 3 / 2
  63.       set offset to -0.001
  64.     else
  65.       set angle to 3.14159260000000007 / 2
  66.       set offset to 0.001
  67.     end if
  68.     set angle to atan(vert / (offset + horz)) + angle
  69.     set angle to integer((angle * (total - 1) / 6.28318520000000014) + 1)
  70.     set snap to word 1 of the name of cast the castNum of sprite the clickOn
  71.     put " " after snap
  72.     put angle after snap
  73.     set the castNum of sprite the clickOn to the number of cast snap
  74.     updateStage()
  75.   end repeat
  76.   set the castNum of sprite the clickOn to myNumber
  77.   puppetSound(0)
  78.   updateStage()
  79. end
  80.  
  81. on motion new, offsetH, offsetV, downSound, upSound
  82.   if stringp(downSound) then
  83.     puppetSound(downSound)
  84.   end if
  85.   set variable to the castNum of sprite the clickOn
  86.   set horz to the locH of sprite the clickOn
  87.   set vert to the locV of sprite the clickOn
  88.   set the castNum of sprite the clickOn to variable + new
  89.   set the locH of sprite the clickOn to horz + offsetH
  90.   set the locV of sprite the clickOn to vert + offsetV
  91.   updateStage()
  92.   repeat while the stillDown or soundBusy(1)
  93.   end repeat
  94.   if stringp(upSound) then
  95.     puppetSound(upSound)
  96.   end if
  97.   set the castNum of sprite the clickOn to variable
  98.   set the locH of sprite the clickOn to horz
  99.   set the locV of sprite the clickOn to vert
  100.   updateStage()
  101.   repeat while soundBusy(1)
  102.   end repeat
  103.   puppetSound(0)
  104.   updateStage()
  105. end
  106.  
  107. on dial total, downSound
  108.   if stringp(downSound) then
  109.     puppetSound(downSound)
  110.   end if
  111.   repeat while the stillDown
  112.     set vert to the mouseV - the locV of sprite the clickOn
  113.     set horz to the mouseH - the locH of sprite the clickOn
  114.     if horz < 0 then
  115.       set angle to 3.14159260000000007 * 3 / 2
  116.       set offset to -0.001
  117.     else
  118.       set angle to 3.14159260000000007 / 2
  119.       set offset to 0.001
  120.     end if
  121.     set angle to atan(vert / (offset + horz)) + angle
  122.     set angle to integer((angle * (total - 1) / 6.28318520000000014) + 1)
  123.     set snap to word 1 of the name of cast the castNum of sprite the clickOn
  124.     put " " after snap
  125.     put angle after snap
  126.     set the castNum of sprite the clickOn to the number of cast snap
  127.     updateStage()
  128.   end repeat
  129.   puppetSound(0)
  130. end
  131.  
  132. on toggle top
  133.   set myName to word 1 of the name of cast the castNum of sprite the clickOn
  134.   repeat while the stillDown
  135.     set vert to the locV of sprite the clickOn - the mouseV
  136.     set vpos to vert / 5
  137.     if vpos > top then
  138.       set vpos to top
  139.     end if
  140.     if vpos < -top then
  141.       set vpos to -top
  142.     end if
  143.     set snap to myName && vpos
  144.     set the castNum of sprite the clickOn to the number of cast snap
  145.     updateStage()
  146.   end repeat
  147.   if value(word 2 of snap) < 0 then
  148.     set vpos to -top
  149.   else
  150.     set vpos to top
  151.   end if
  152.   set snap to myName && vpos
  153.   set the text of cast "string" to snap
  154.   set the castNum of sprite the clickOn to the number of cast snap
  155.   updateStage()
  156. end
  157.  
  158. on switch total, delay, downSound
  159.   if stringp(downSound) then
  160.     puppetSound(downSound)
  161.   end if
  162.   set variable to the castNum of sprite the clickOn
  163.   repeat with n = 1 to abs(total) - 1
  164.     set wait to the timer + delay
  165.     if total > 0 then
  166.       set the castNum of sprite the clickOn to variable + n
  167.     else
  168.       set the castNum of sprite the clickOn to variable - n
  169.     end if
  170.     updateStage()
  171.     repeat while wait > the timer
  172.     end repeat
  173.   end repeat
  174.   repeat while soundBusy(1)
  175.   end repeat
  176.   puppetSound(0)
  177. end
  178.  
  179. on loop total, delay, soundLoop
  180.   if stringp(soundLoop) then
  181.     puppetSound(soundLoop)
  182.   end if
  183.   set myNumber to the castNum of sprite the clickOn
  184.   repeat while the stillDown
  185.     repeat with n = 1 to total - 1
  186.       set wait to the timer + delay
  187.       set the castNum of sprite the clickOn to myNumber + n
  188.       updateStage()
  189.       repeat while wait > the timer
  190.       end repeat
  191.     end repeat
  192.     set the castNum of sprite the clickOn to myNumber
  193.     updateStage()
  194.   end repeat
  195.   puppetSound(0)
  196. end
  197.  
  198. on pointer total, downSound
  199.   if stringp(downSound) then
  200.     puppetSound(downSound)
  201.   end if
  202.   repeat while the stillDown
  203.     set vert to the mouseV - the locV of sprite the clickOn
  204.     set horz to the mouseH - the locH of sprite the clickOn
  205.     set angle to 3.14159260000000007 / 4
  206.     set angle to atan(horz / (0.001 - vert)) + angle
  207.     set angle to integer((angle * (total - 1) / 3.14159260000000007 * 2.0) + 1)
  208.     if angle > total then
  209.       set angle to total
  210.     end if
  211.     if angle < 1 then
  212.       set angle to 1
  213.     end if
  214.     if vert < 0 then
  215.       set snap to word 1 of the name of cast the castNum of sprite the clickOn
  216.       put " " after snap
  217.       put angle after snap
  218.       set the castNum of sprite the clickOn to the number of cast snap
  219.       updateStage()
  220.     end if
  221.   end repeat
  222.   puppetSound(0)
  223.   updateStage()
  224. end
  225.  
  226. on steps total, delay, downSound
  227.   if stringp(downSound) then
  228.     puppetSound(downSound)
  229.   end if
  230.   set myCast to the castNum of sprite the clickOn
  231.   set myName to the name of cast myCast
  232.   set myNumber to word 2 of myName
  233.   set myName to word 1 of myName
  234.   repeat while the stillDown
  235.     set wait to the timer + delay
  236.     set myNumber to value(myNumber) + 1
  237.     if myNumber > total then
  238.       set myNumber to 1
  239.     end if
  240.     set myCast to myName && myNumber
  241.     set the castNum of sprite the clickOn to the number of cast myCast
  242.     set the locH of sprite the clickOn to the mouseH
  243.     set the locV of sprite the clickOn to the mouseV
  244.     updateStage()
  245.     repeat while wait > the timer
  246.     end repeat
  247.   end repeat
  248.   puppetSound(0)
  249.   updateStage()
  250. end
  251.  
  252. on thumb total, delay, downSound
  253.   if stringp(downSound) then
  254.     puppetSound(downSound)
  255.   end if
  256.   set myCast to the castNum of sprite the clickOn
  257.   set myName to the name of cast myCast
  258.   set myNumber to word 2 of myName
  259.   set myName to word 1 of myName
  260.   repeat while the stillDown
  261.     set wait to the timer + delay
  262.     if the mouseV > the locV of sprite the clickOn then
  263.       set myNumber to value(myNumber) + 1
  264.       if myNumber > total then
  265.         set myNumber to 1
  266.       end if
  267.     else
  268.       set myNumber to value(myNumber) - 1
  269.       if myNumber < 1 then
  270.         set myNumber to total
  271.       end if
  272.     end if
  273.     set myCast to myName && myNumber
  274.     set the castNum of sprite the clickOn to the number of cast myCast
  275.     updateStage()
  276.     repeat while wait > the timer
  277.     end repeat
  278.   end repeat
  279.   puppetSound(0)
  280.   updateStage()
  281. end
  282.  
  283. on flash downSound, upSound
  284.   if stringp(downSound) then
  285.     puppetSound(downSound)
  286.   end if
  287.   set the ink of sprite the clickOn to 4
  288.   updateStage()
  289.   repeat while the stillDown or soundBusy(1)
  290.   end repeat
  291.   if stringp(upSound) then
  292.     puppetSound(upSound)
  293.   end if
  294.   set the ink of sprite the clickOn to 36
  295.   updateStage()
  296.   repeat while soundBusy(1)
  297.   end repeat
  298.   puppetSound(0)
  299. end
  300.